<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" class="off">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<link href="__ROOT__/statics/admin/css/style.css" rel="stylesheet" type="text/css"/>
<link href="__ROOT__/statics/css/dialog.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="__ROOT__/statics/js/jquery/jquery-1.4.2.min.js"></script>
<script language="javascript" type="text/javascript" src="__ROOT__/statics/js/dialog.js"></script>
<title>{$Think.lang.website_manage}</title>
</head>

<body scroll="no">
<div id="header">
	<div class="logo"><a href="__APP__" title="{$Think.lang.website_manage}"></a></div>
    <div class="fr">
    	<div class="tab_style white cut_line tr"><a href="javascript:flush_cache();" target="_blank">{$Think.lang.flush_cache}</a>
        </div>
        <div class="style_but"></div>
    </div>
    <div class="col-auto" style="overflow: visible">
        <div class="log white cut_line">
            {$Think.lang.hello}！andery<span>|</span>
            <a href="?a=logout">[{$Think.lang.logout}]</a><span>|</span>
            <a href="{$site_real_url}" target="_blank">{$Think.lang.site_home}</a><span>|</span>
        </div>
    </div>
    <ul class="nav white" id="top_menu">
    	<volist name="top_menu" id="val" >
		<li id="_M{$val.id}" class="top_menu"><a href="javascript:_M({$val.id},'')"  hidefocus="true" style="outline:none;">{$val.title}</a></li>
        </volist>
    </ul>
</div>
<div id="content">
	<div class="left_menu fl">
    	<div id="leftMain"></div>
        <a href="javascript:;" id="openClose" style="outline-style: none; outline-color: invert; outline-width: medium;" hideFocus="hidefocus" class="open" title="{$lang.expand_or_contract}"></a>
    </div>
    <div class="right_main">
    	<div class="crumbs">
    		<div class="shortcut cu-span">
            	<a href="javascript:sync_taobao_trades();"><span>同步淘宝订单</span></a>
            	<a href="javascript:Refresh();"><span>{$Think.lang.refresh_page}</span></a>
            </div>
    		<span id="current_pos"></span>
        </div>
    	<div class="rmc">
        	<div class="content" style="position:relative; overflow:hidden">
                <iframe name="right" id="rightMain" src="{:u('index/panel')}" frameborder="false" scrolling="auto" style="overflow-x:hidden;border:none;" width="100%" height="auto" allowtransparency="true"></iframe>
        	</div>
        </div>
    </div>
</div>
<div id="ajax_loading" style="position:absolute; right:0; top:0;"></div>
<script type="text/javascript">
function windowW(){
	if($(window).width()<980){
			$('#header').css('width',980+'px');
			$('#content').css('width',980+'px');
			$('body').attr('scroll','');
			$('body').css('overflow','');
	}
}
windowW();
$(window).resize(function(){
	if($(window).width()<980){
		windowW();
	}else{
		$('#header').css('width','auto');
		$('#content').css('width','auto');
		$('body').attr('scroll','no');
		$('body').css('overflow','hidden');
		
	}
});
window.onresize = function(){
	var heights = document.documentElement.clientHeight-110;
	document.getElementById('rightMain').height = heights;
	var openClose = $("#rightMain").height()+9;
	$('#center_frame').height(openClose+9);
	$("#openClose").height(openClose+30);	
}
window.onresize();

$(function(){
	//默认载入左侧菜单
	$("#leftMain").load("{:u('Index/menu', array('menuid'=>1))}");
	$.get("{:u('Index/current_pos', array('menuid'=>1))}", function(data){
		$("#current_pos").html(data);
	});
})

//左侧开关
$("#openClose").click(function(){
	if($(this).data('clicknum')==1) {
		$("html").removeClass("on");
		$(".left_menu").removeClass("left_menu_on");
		$(this).removeClass("close");
		$(this).data('clicknum', 0);
	} else {
		$(".left_menu").addClass("left_menu_on");
		$(this).addClass("close");
		$("html").addClass("on");
		$(this).data('clicknum', 1);
	}
	return false;
});

function _M(menuid,targetUrl) {
	$("#leftMain").load("{:u('index/menu')}", {menuid:menuid});
	//$("#rightMain").attr('src', targetUrl);
	$('.top_menu').removeClass("on");
	$('#_M'+menuid).addClass("on");
	
	$.get("{:u('index/current_pos')}", {menuid:menuid}, function(data){
		$("#current_pos").html(data);
	});
	
	//显示左侧菜单，当点击顶部时，展开左侧
	$(".left_menu").removeClass("left_menu_on");
	$("#openClose").removeClass("close");
	$("html").removeClass("on");
	$("#openClose").data('clicknum', 0);
	$("#current_pos").data('clicknum', 1);
}

function _MP(menuid,targetUrl) {
	$("#rightMain").attr('src', targetUrl);
	$('.sub_menu').removeClass("on fb blue");
	$('#_MP'+menuid).addClass("on fb blue");
	$("#current_pos").data('clicknum', 1);
	$.get("{:u('index/current_pos')}", {menuid:menuid}, function(data){
		$("#current_pos").html(data);
	});
}

function Refresh() {
	var src = $("#rightMain").attr('src');
	$("#rightMain").attr('src',src);
}

function sync_taobao_trades() {	
	window.top.art.dialog({id:'sync_taobao_trades'}).close();
	var sync_url = "{:u('Orders/sync_taobao_trades')}";
	window.top.art.dialog({title:'正在同步淘宝订单数据',id:'sync_taobao_trades',iframe:sync_url,width:'300',height:'70'}, function(){var d = window.top.art.dialog({id:'sync_taobao_trades'}).data.iframe;d.document.getElementById('dosubmit').click();return false;}, function(){window.top.art.dialog({id:'edit'}).close()});
}
</script>
</body>
</html>